<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script>
    //结账确认
    function  acctConfirm(){
        $.ajax({
              type:'post',
              url:'${ctx}/finance/outpAcctMaster/save',
              data:$('#patientInfo').serialize(),
              success:function(data){
               if(data.code=='success'){
                    toastr.success("结账成功");
                    loadDiv('mainCenterDiv','${ctx}/finance/outpRcptMaster/outpAcct');
                    return;
               } else{
                       toastr.error("结账失败");
                       return ;
                   }
             }
        });
    }
</script>
<div class="app bg-default">
    <section class="layout">
        <div class="content-wrap">
            <div class="row" id="topDivId">
                <div class="col-lg-12">
                    <section class="panel">
                        <div class="panel-body">
                            <form class="form-inline" id="patientInfo" onsubmit="return loadDivForm('acctInfo','patientInfo','${ctx}/finance/outpRcptMaster/acctMaster');" method="post" >
                                <label>日期 ：</label>
                                <c:choose>
                                    <c:when test="${startTime!=null && startTime!=''}">
                                        <input name="startTime" value="${startTime}"  id="startTime"  class="form-control Wdate"  readonly="true"/>
                                    </c:when>
                                    <c:otherwise>
                                        <input name="startTime" value="${startTime}"  id="startTime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});" class="form-control Wdate"  readonly="true"/>
                                    </c:otherwise>
                                </c:choose>
                                &nbsp;
                                至<input name="endTime" value="${endTime}" id="acctEndDate"  class="form-control Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
                                <label>结账序号:</label><input name="acctNo" value="${acctNo}" id="acctNo" class="form-control"  readonly="true" />&nbsp;&nbsp;
                                &nbsp;&nbsp;<input  class="btn btn-success" type="submit" value="结账累计"/>
                                &nbsp;&nbsp;<input  class="btn btn-primary" type="button" value="结账确认" onclick="acctConfirm();"/>
                            </form>
                        </div>
                    </section>
                </div>
            </div>
            <div class="row">
                <section class="panel">
                    <div class="panel-body">
                        <form class="form-inline" id="masterInfo">
                            <label>收据张数 ：</label><input  id="rcptsNum" name="rcptsNum" class="form-control" style="width: 100px;"/>&nbsp;
                            <label>退费张数:</label><input   id="refundNum" name="refundNum" class="form-control"  style="width: 100px;"/>&nbsp;
                            <label>退费金额:</label><input id="refundAmount"  name="refundAmount" class="form-control"  style="width: 100px;"/>&nbsp;
                            <label>应收:</label><input id="sumAmount" name="sumAmount" class="form-control"  style="width: 100px;"/>&nbsp;
                            <label>实收:</label><input id="chargesAmount" name="chargesAmount" class="form-control"   style="width: 100px;"/>
                        </form>
                    </div>
                </section>
            </div>
            <div class="row" id="acctInfo">
               <jsp:include page="outpAcctMasterIndex.jsp"></jsp:include>
            </div>
        </div>
    </section>
</div>
</div>
</div>